//
//  BRUserManager.h
//  BrezzeSaaS
//
//  Created by IOS on 2021/9/1.
//  Copyright © 2021 Brezze GWG. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BRRuleModel.h"
#import "BRTenantModel.h"
#import "BRRewardSwitchModel.h"
#import "BROrderDetailModel.h"
#import "BRSchemeManage.h"

NS_ASSUME_NONNULL_BEGIN

@interface BRUserManager : NSObject

+ (instancetype)share;

@property (nonatomic,assign) BOOL isLogin;
@property (nonatomic,strong) NSString *loginTenantId;//是否登录了在选择平台页面
@property (nonatomic,strong) NSString *token;
/// 用户推送Key
@property (nonatomic,strong) NSString *userNotiKey;
@property (nonatomic,strong) BRUserModel *userModel;
@property (nonatomic,strong) NSArray <BRConfigModel *>*configs;
/// 记录登陆选项
@property (nonatomic,assign) NSInteger loginType;
/// 订单状态 1有租借中
//@property (nonatomic,assign) NSInteger orderType;
@property (nonatomic,strong,nullable) BROrderDetailModel *orderModel;
/// 文件路径域名
@property (nonatomic,strong) NSString *filesSever;
/// 邀请用链接
@property (nonatomic,strong) NSString *invitationUrl;
/// whatsapp
@property (nonatomic,strong) NSString *whatsapp;
/// WX 二维码链接
@property (nonatomic,strong) NSString *qrCodeWX;
/// zalo 二维码链接
@property (nonatomic,strong) NSString *qrCodeZalo;

@property (nonatomic,strong) BRRuleModel *ruleModel;

@property (nonatomic,strong) BRTenantModel *tenantModel;
/// 最近选择的租户 选3个
@property (nonatomic,strong) NSArray *tenantList;
/// 个人积分
@property (nonatomic,assign) NSInteger point;

/// 租借规则
@property (nonatomic,strong) NSString *rentRule;
///  currencyJson
@property (nonatomic,copy) NSString *currencyJson;
/// 金额单位符号
@property (nonatomic,strong) NSString *priceSymbol;
/// country:@"SG" currency:@"SGD" 支持的国家和货币
@property (nonatomic,copy) NSString *country;
@property (nonatomic,copy) NSString *currency;

/// 协议 相关
@property (nonatomic,strong) NSString *privacyPolicy;
@property (nonatomic,strong) NSString *termsOfUse;

#pragma mark - 位置相关
/// 全局默认位置（纬度）
@property (nonatomic,assign) CGFloat globalLatitude;
/// 全局默认位置（经度）
@property (nonatomic,assign) CGFloat globalLongitude;
@property (nonatomic,strong) NSString *depositPolicy;
@property (nonatomic,strong) NSString *preAuthorizationPolicy;
/// 报失金额
@property (nonatomic,strong) NSDecimalNumber *lostPrice;

/// 联系方式
@property (nonatomic,strong) NSString *contactPhone;
@property (nonatomic,strong) NSString *contactEmail;
///  奖励开关json
@property (nonatomic,copy) NSString *rewardsSwitchJson;
@property (nonatomic,strong) BRRewardSwitchModel *rewardSwitchModel;
@property (nonatomic,assign) NSInteger switchInvite;//邀请入口开关 1 开

/// 扫码页->钱包  （绑卡/充押金成功后返回扫码页）
@property (nonatomic,assign) BOOL isScanIn;

/// 商家中心 请求id
@property (nonatomic,strong) NSString *branchId;

@property (nonatomic,strong) BRSchemeModel *schemeModel;

/// 记录登录的信息
@property (nonatomic,strong) NSString *loginPhone;
@property (nonatomic,strong) NSString *loginCode;
@property (nonatomic,strong) NSString *loginEmail;

/// 清除登录状态
- (void)logoutClean;
/// 退出登录，包含退出接口调用，数据清除操作
- (void)logout:(void(^)(void))succ faile:(void(^)(void))faile;
/// 切换根控制器 
- (void)toChangeRootVC;
/// 个人信息获取
+ (void)requestUserInfo:(void(^)(void))succ faile:(void(^)(void))faile;
/// 获取用户详细信息（新接口）
+ (void)requestUserCenterInfo:(void(^)(void))succ faile:(void(^)(void))faile;
/// 个人积分获取
+ (void)requestPoints:(void(^)(void))succ faile:(void(^)(void))faile;
/// 获取系统配置
+ (void)requestConfigs:(void(^)(void))succ faile:(void(^)(void))faile;
/// 获取租借规则
+ (void)requestRule:(void(^)(void))succ faile:(void(^)(void))faile;
/// 退出登录请求
+ (void)logoutRequest:(void(^)(void))succ faile:(void(^)(void))faile;
/// 切换主题色
+ (void)changTenantStyle:(NSInteger)tenantId;

+ (void)save:(BRTenantModel *)model;


/*
 * 登录选择的平台 "platformId": 0,、"qrUrl": "","sno": ""
 */
+ (void)loginPlatformRequest:(NSDictionary *)req succ:(void(^)(void))succ faile:(void(^)(void))faile;

/// 获取用户钱包
+ (void)getWallet:(void(^)(NSDictionary *dataDict, NSInteger respCode))succeed failed:(void(^)(NSInteger code,NSString *errMsg))failed;

/// 根据规则模型返回对应的数据文本
- (NSString *)br_ruleOfModel:(BRRuleModel *)dto;

/// 调试方法：打印用户状态信息到控制台
- (void)br_logUserStatus;

@end

NS_ASSUME_NONNULL_END
